import {
	getAddressListApi,
	getAddressDetailApi,
	putAddressApi,
	saveAddressApi,
	putAddressDefaultApi,
	delAddressApi,
	getRegionApi
} from '@/apis/address.js';

function getAddressList(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	getAddressListApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function getAddressDetail(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	getAddressDetailApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function putAddress(info, id, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	putAddressApi(info, id).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function putAddressDefault(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	putAddressDefaultApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function saveAddress(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	saveAddressApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function delAddress(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	delAddressApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}

function getRegion(info, successCallback, errCallback) {
	// 此时需要您的接口返回个人信息
	getRegionApi(info).then(res => {
		successCallback && successCallback(res)
	}, err => {
		errCallback && errCallback(err)
	});
}




export {
	getAddressList,
	getAddressDetail,
	putAddress,
	putAddressDefault,
	delAddress,
	saveAddress,
	getRegion
}